package smartlifev30.com.sdk.util;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 *
 * @author tys
 * @date 2018/8/12
 */

public class Tools {

    public static String formatTime(@NonNull Long time, @Nullable String pattern) {
        SimpleDateFormat format = new SimpleDateFormat(pattern == null ? "yyyy-mm-dd HH:mm:ss" : pattern, Locale.getDefault());
        return format.format(new Date(time));
    }

}
